﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Mail;
using System.Net.Mime;

namespace SubsidyApp.Helpers
{
    public class MailHelper
    {
        public static void Send(string mailTo, string subject, string bodyText)
        {
            SmtpClient client = new SmtpClient("smtp.mail.ru", 25);
            client.Credentials = new NetworkCredential("madman.lic", "1061aoq.");
            using (MailMessage msg = new MailMessage())
            {
                msg.From = new MailAddress("madman.lic@mail.ru");
                msg.To.Add(new MailAddress(mailTo));
                msg.Subject = subject;
                msg.Body = bodyText;
                //foreach (string file in mail.sendFiles)
                //{
                //    msg.Attachments.Add(new Attachment(file, MediaTypeNames.Application.Octet));
                //}
                client.Send(msg);
            }

        }
    }
}